﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using OABLL;
using OAModel;

namespace MyOA
{
    
    public partial class ChaKanZhuanZheng : Form
    {  ZhuanZhengBLL bll = new ZhuanZhengBLL();
        public  string _yuangongid = string.Empty;
      
        public string _txt转正内容 = string.Empty;

        public string _Oa申请号 = string.Empty;

        public ChaKanZhuanZheng(string oa ,string  Oa申请号)
        {
            _yuangongid = oa;

            _Oa申请号 = Oa申请号;
           
            InitializeComponent();
          
    
        }

     
            
        
    
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void btn转正删除_Click(object sender, EventArgs e)
        {
           
        }

        private void btn修改转正_Click(object sender, EventArgs e)
        {
            ZhuanzhengEntity zz = new ZhuanzhengEntity();
            zz.Oa员工id = lb员工id.Text;
            zz.Oa员工姓名 = label4.Text;
            zz.Oa转正内容 = txt转正内容.Text.Trim();

            zz.Oa申请号 = _Oa申请号;
            bool bl = bll.Upzhuanzheng(_txt转正内容, zz);

            if (bl == true)
            {
                MessageBox.Show("提交申请成功，等待审批中！");
            }
            else
            {

                MessageBox.Show("提交失败，请稍后重试！");
            }


        }

        private void ChaKanZhuanZheng_Load(object sender, EventArgs e)
        {
            OAUseEntity user = new OAUseBLL().Getyuangong(_yuangongid);
            this.lb员工id.Text = user.Oa员工id;
            this.label4.Text = user.Oa姓名;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
    }
